package com.example.smarthome;

public class SmartLight extends SmartDevice {
    private int brightness;

    public SmartLight(String id, String name) {
        super(id, name);
        this.brightness = 50;
    }

    public void setBrightness(int level) {
        if (level < 0 || level > 100) {
            System.out.println("亮度值无效！");
            return;
        }
        brightness = level;
        System.out.println(deviceName + " 亮度设置为 " + brightness);
    }

    @Override
    public String getDeviceType() {
        return "智能灯";
    }
}